import { commonUrl } from '@/config/index'
import axios from 'axios'

export function getSessionId() { // 图片验证码
    return axios.get(commonUrl.getSessionId,{}).then((res) => {
        return res.data
    }) 
}

export function sendSms(username,sess_id,img_code,sms_type) {  // 短信验证码
    return axios.post(commonUrl.sendSms,{
        username,
        sess_id,
        img_code,
        sms_type
    }).then((res) => {
        return res.data
    }) 
}

export function register(args) {  // 注册
    return axios.post(commonUrl.register,{
        investor_name: args.tel,
        investor_pwd: args.pwd,
        sms_code: args.dxCode,
        referee_number: args.inviteCode
    }).then((res) => {
        return res.data
    }) 
}

export function login(investor_name,investor_pwd) {  // 登录
    return axios.post(commonUrl.login,{
        investor_name,
        investor_pwd
    }).then((res) => {
        return res.data
    }) 
}

export function info() {  // 基本资料
    return axios.get(commonUrl.info,{
    }).then((res) => {
        return res.data
    }) 
}
